<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>优惠券管理</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}"  media="all">
    <link rel="stylesheet" th:href="@{/css/couponCss.css}" type="text/css">
    <script rel="script" type="text/javascript" th:src="@{/js/jquery-3.5.1.min.js}"></script>
    <script rel="script" type="text/javascript" th:src="@{/layui/layui.js}"></script>
    <script rel="script" type="text/javascript" th:src="@{/js/couponJs.js}"></script>


</head>

<body>
<form class="layui-form layui-form-myStyle" action="">
    <div class="demoTable">
        <div class="layui-col-myStyle">
            <div class="layui-inline layui-div-text">
                优惠券名称：
                <div class="layui-inline">
                    <input class="layui-input" name="couponName" id="coupon_search" autocomplete="off" placeholder="请输入关键信息">
                </div>
            </div>
            <div class="layui-inline layui-div-text">
                类型
                <div class="layui-inline">
                    <select name="type" lay-filter="aihao" id="coupon_type">
                        <option value="">请选择</option>
                        <option value="1">定额</option>
                        <option value="2">满减</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline layui-div-text">
                状态
                <div class="layui-inline">
                    <select name="status" lay-filter="aihao" id="coupon_status">
                        <option value="">请选择</option>
                        <option value="1">未过期</option>
                        <option value="2">已过期</option>
                    </select>
                </div>
            </div>

            <div class="layui-other-myStyle">
                <div class="layui-inline layui-div-text">
                    开始时间：
                    <div class="layui-inline">
                        <input type="text" class="layui-input" name="startTimeTo" id="coupon_startTime_to" autocomplete="off"  placeholder="请选择开始的起始时间">
                    </div>
                    —
                    <div class="layui-inline">
                        <input type="text" class="layui-input" name="startTimeEnd" id="coupon_startTime_end" autocomplete="off" placeholder="请选择开始的截止时间">
                    </div>
                </div>
                <div class="layui-inline layui-div-text">
                    结束时间：
                    <div class="layui-inline">
                        <input type="text" class="layui-input" name="endTimeTo" id="coupon_endTime_to" autocomplete="off" placeholder="请选择结束的起始时间">
                    </div>
                    —
                    <div class="layui-inline">
                        <input type="text" class="layui-input" name="endTimeEnd" id="coupon_endTime_end" autocomplete="off" placeholder="请选择结束的截止时间">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-myStyle-two layui-input-inline">
            <a class="layui-btn" data-type="reload">搜索</a>
            <a class="layui-btn" onclick="couponAdd()">新增优惠券</a>
        </div>
    </div>
</form>
<table class="layui-hide" id="coupon_table" lay-filter="user"></table>

<div id="coupon_install" class="layui-form" lay-filter="coupon_install" style="display: none">
    <form class="layui-form layui-form-pane" action="">
        <div class="layui-form-item">
            <label class="layui-form-label">优惠券名称</label>
            <div class="layui-input-inline">
                <input type="text" name="name" id="add_coupon_name" lay-verify="required" placeholder="请输入优惠券名称" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">优惠券类型</label>
            <div class="layui-input-inline">
                <select name="type" lay-filter="aihao" id="add_coupon_type">
                    <option value="">请选择</option>
                    <option value="1">定额</option>
                    <option value="2">满减</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">开始时间</label>
            <div class="layui-input-inline">
                <input type="text" name="startTime" id="add_coupon_startTime" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">结束时间</label>
            <div class="layui-input-inline">
                <input type="text" name="endTime" id="add_coupon_endTime" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">满减总金额</label>
            <div class="layui-input-inline">
                <input type="text" name="totolAmount" id="add_coupon_totolAmount" lay-verify="required" placeholder="请输入满减总金额" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">折扣金额</label>
            <div class="layui-input-inline">
                <input type="text" name="discountAmount" id="add_coupon_discountAmount" lay-verify="required" placeholder="请输入折扣的金额" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">数量</label>
            <div class="layui-input-inline">
                <input type="text" name="amount" id="add_coupon_amount" lay-verify="required" placeholder="请输入需要发放的数量" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit lay-filter="couponAdd">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
</body>
</html>